﻿using System.IO.Compression;

namespace Sgr.AspNetCore
{
    /// <summary>
    /// 响应压缩配置
    /// </summary>
    public class CompressionSettings
    {
        /// <summary>
        /// 是否启用压缩
        /// </summary>
        public bool EnableCompression { get; set; } = true;

        /// <summary>
        /// 启用HTTPS压缩
        /// </summary>
        public bool EnableForHttps { get; set; } = true;

        /// <summary>
        /// 压缩级别
        /// </summary>
        public CompressionLevel CompressionLevel { get; set; } = CompressionLevel.Fastest;

        /// <summary>
        /// 最小压缩大小(字节)
        /// </summary>
        public int MinimumSizeToCompress { get; set; } = 1024;

        /// <summary>
        /// MIME类型
        /// </summary>
        public string[] MimeTypes { get; set; } = new[]
        {
        "text/plain",
        "text/html",
        "text/css",
        "text/xml",
        "text/json",
        "application/javascript",
        "application/json",
        "application/xml",
        "application/x-www-form-urlencoded"
    };
    }
}